package com.zyg.manager.controller;

import com.zyg.manager.entity.ContentEntity;
import com.zyg.manager.service.ContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 类名：
 * 作者：LMY
 * 创建时间：2021/11/1-22:57
 * 功能:
 */
@Controller
public class PortalController {

    @Autowired
    private ContentService contentService;
   /**
    * 作者：LMY
    * 功能：xx
    * 时间：2021/11/1 23:26
    */
    @RequestMapping({"/","/index.html"})
    public String findAll(Model model){
        List<ContentEntity> list = contentService.findAll();
        model.addAttribute("list",list);
        return "index";
    }
}
